<?php $this->load->view('sys_header');?>

<script type="text/javascript">


    function ajax_submit(){

        //验证表单
        editor.sync(); //同步编辑器数据
        $.ajax({
            type:"post",
            dataType:'json',
            url:'<?php echo made_admin_url('product/insert');?>',
            data:$('#cpform').serialize(),
            success:function(r){
                if(r && r.success)
                {
                    $.messager.confirm('成功提示', r.msg , function(b){
                        document.location.href = '<?php echo made_admin_url('product');?>';
                    });
                }
                else
                {
                    lin.msg(r.msg,'error');
                }
            }
        });

    }









</script>




<div class="nav">
    <h2><a href="<?php echo made_admin_url('main/mainfra');?>">TAYCMS后台管理</a> >  <a href="<?php echo made_admin_url('product');?>">产品管理</a> > <a href="<?php echo made_admin_url('product/addproduct');?>">添加</a> </h2>
</div>



<div class="contenter">
    <div class="addpage">
    <h1></h1>
    <div class="ml"></div>

    <div id="editform">

        <form name="cpform" method="post" autocomplete="off"    id="cpform"   >

            <table  width="100%" border="0" align="left" cellpadding="0" cellspacing="0" >
                <TR>
                    <TD width="100%">

                        <table width="95%" border="0" align="center" cellpadding="3" cellspacing="0"  >
                            <tr>
                                <td width="12%" height="30"><span class="red">*</span>产品名称：</td>
                                <td width="88%"><label>
                                    <input type="text" name="proname" id="proname" class="border" value="" size="50" />
                                </label></td>
                            </tr>

                            <tr>
                                <td><span class="red">*</span>分类：</td>
                                <td><select name="classid" class="select" style="width: 160px;" >
                                    <option value="0">请选择信息分类</option>
                                    <?php foreach($info_class as $i): ?>
                                    <option value="<?php echo $i['classid']?>" ><?php echo $i['classname']?></option>
                                    <?php endforeach; ?>
                                </select></td>
                            </tr>

                            <tr>
                                <td width="12%" height="25">推荐等级：</td>
                                <td width="88%"><label>
                                    <select name="isgood" id="isgood" class="select" style="width: 80px;">
                                        <option value="0" selected>不推荐</option>
                                        <option value="1">一级推荐</option>
                                        <option value="2">二级推荐</option>
                                        <option value="3">三级推荐</option>
                                        <option value="4">四级推荐</option>
                                        <option value="5">五级推荐</option>
                                        <option value="6">六级推荐</option>
                                        <option value="7">七级推荐</option>
                                        <option value="8">八级推荐</option>
                                        <option value="9">九级推荐</option>
                                    </select>
                                </label></td>
                            </tr>




                            <tr>
                                <td>产品图1：</td>
                                <td>
                                    <?php echo load_imagebtn('showpic'); ?>
                                    <label>
                                        <input name="showpic" id="showpic" class="border" type="text" size="40" value="" readonly="readonly" /> <input type="button" id="image" value="上传图片" class="sub_btn" /> (此图作为标题图片)
                                    </label>
                                </td>
                            </tr>

                            <tr>
                                <td>产品图2：</td>
                                <td>
                                    <?php echo load_imagebtn('showpic2','image2'); ?>
                                    <label>
                                        <input name="showpic2" id="showpic2" class="border" type="text" size="40" value="" readonly="readonly" /> <input type="button" id="image2" value="上传图片" class="sub_btn" />
                                    </label>
                                </td>
                            </tr>

                            <tr>
                                <td>产品图3：</td>
                                <td>
                                    <?php echo load_imagebtn('showpic3','image3'); ?>
                                    <label>
                                        <input name="showpic3" id="showpic3" class="border" type="text" size="40" value="" readonly="readonly" /> <input type="button" id="image3" value="上传图片" class="sub_btn" />
                                    </label>
                                </td>
                            </tr>




                            <tr>
                                <td>产品简介：</td>
                                <td><label>
                                    <textarea name="notice" id="notice" cols="45" rows="5" class="border" style="height:100px; width: 280px;" ></textarea>
                                </label></td>
                            </tr>

                            <tr>
                                <td>详细内容：</td>
                                <td>
                                    <?php echo load_editor(); ?>
                                </td>
                            </tr>



                            <tr>
                                <td height="25">外部链接：</td>
                                <td><label>
                                    <input type="text" name="url" id="url" size="50" class="border" />
                                    填写后直接跳转到链接，不外链请勿填写。 </label></td>
                            </tr>

                            <tr>
                                <td height="25">关键字：</td>
                                <td><label>
                                    <input name="keyboard" type="text" size="50" value="" class="border" />
                                    (多个请用&quot;,&quot;隔开，字数255以内) </label></td>
                            </tr>




                            <tr>
                                <td height="30">添加时间：</td>
                                <td><label>
                                    <input type="text" name="addtime" id="addtime" size="30" readonly="readonly"  class="easyui-datetimebox border" style="width: 140px;" value="" />
                                    请使用正确格式如：2012-03-25 11:47:48</label></td>
                            </tr>

                        </table>


                    </TD>
                </TR>
                <tr>
                    <td height="30" colspan="2" align="center">
                        <br><br>
                        <label>
                        <input name="submit" type="button" id="submit" value="提交" onclick="ajax_submit()"   class="sub_btn" />
                    </label>
                        <label>
                            <input name="re" type="button" id="re" value="返回" onclick="window.location.href='<?php echo made_admin_url('product');?>'"   class="sub_btn" />
                        </label>
                    </td>
                </tr>
            </table>


        </form>


    </div>

</div>
</div>







<?php $this->load->view('sys_footer');?>